function checkName(){
	var name = document.getElementById("name").value;
	if(name=="" || name==null){
		document.getElementById("name").focus();
		document.getElementById("qqn").innerHTML="<a style='color:red;font-size:12px;'>姓名不能为空</a>";
	}else{
		document.getElementById("qqn").innerHTML="<a style='color:gold;font-size:12px;'>填写正确</a>";
	}
	return;
}

function checkOther(){
	var age = document.getElementById("age").value;
	var messa = document.getElementById("messa").value;
	
	checkFav();
	checkSex();
	if(age=="" || age==null){
		alert("请选择年龄");
		document.getElementById("qqa").innerHTML="<a style='color:red;font-size:12px;'>请选择年龄</a>";
	}else{
		document.getElementById("qqa").innerHTML="<a style='color:gold;font-size:12px;'>操作正确</a>";
	}
	if(messa=="" || messa==null){
		document.getElementById("messa").focus();
		document.getElementById("qqm").innerHTML="<a style='color:red;font-size:12px;'>请填写留言</a>";
	}else{
		document.getElementById("qqm").innerHTML="<a style='color:gold;font-size:12px;'>操作正确</a>";
	}
	return;
}

function checkFav(){ 
	
	var r=document.getElementsByName("fav"); 
	var flag = 0;
    for(var i=0;i<r.length;i++){
         if(r[i].checked){
			flag++;
        }
        	
    } 
    if(flag==0){
		alert("请选择爱好");
		document.getElementById("qqf").innerHTML="<a style='color:red;font-size:12px;'>请选择爱好</a>";
        		
    }else{
			document.getElementById("qqf").innerHTML="<a style='color:gold;font-size:12px;'>操作正确</a>";
    	
    }
}
 function checkSex(){ 
	
	var r=document.getElementsByName("sex"); 
	var flag = 1;
    for(var i=0;i<r.length;i++){
         if(r[i].checked){
			document.getElementById("qqs").innerHTML="<a style='color:gold;font-size:12px;'>操作正确</a>";
			flag=0;
			continue;
        }else{
        	if(i==r.length-1 && flag==1){
				alert("请选择性别");
				document.getElementById("qqs").innerHTML="<a style='color:red;font-size:12px;'>请选择性别</a>";
        		
        	}
        }
    }  
}